package internet;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class InetAddressDemo {
    public static void main(String[] args) throws UnknownHostException {
        //192.168.0.102
        InetAddress byName = InetAddress.getByName("DESKTOP-9BC50MU");

        String hostAddress = byName.getHostAddress();
        String hostName = byName.getHostName();
        System.out.println(hostName+ ","+hostAddress);


    }
}
